import {Effect} from "../../IEffectContainer";
import {ActorActionManager} from "../../../manager/ActorActionManager";
import { Constant } from "../../../../config/Constant";

export class huixue extends Effect {
    logLevel = "huixue"

    apply(target: ActorActionManager) {
        super.apply(target)
        this.log.log('test_fight', '回血')
        const recoveryAmount = target.actorProperty.maxHp * this.num[this.level-1];
        if (target.actorProperty.hp < target.actorProperty.maxHp) {
            target.actorProperty.hp += recoveryAmount;
            target.actorProperty.hp = Math.min(parseFloat(target.actorProperty.hp.toFixed(Constant.GAME_SET.NumFixed)), target.actorProperty.maxHp);
            target.updateHpHitUI(recoveryAmount,3)
            target.updateHpBarUI()
        }
    }

}
